﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'proc_cm_DeleteAnnouncement')
BEGIN
    PRINT 'Dropping Procedure proc_cm_DeleteAnnouncement'
    DROP  Procedure  proc_cm_DeleteAnnouncement
END
GO

PRINT 'Creating Procedure proc_cm_DeleteAnnouncement'
GO

CREATE PROCEDURE [dbo].[proc_cm_DeleteAnnouncement]
	@pHtmlPageId uniqueidentifier 
	, @pSectionCd nvarchar(50) = 'Main'
	, @pAnnouncementId uniqueidentifier
AS
BEGIN
	SET NOCOUNT ON

	DELETE FROM [dbo].[tbl_announcement] 
	WHERE [html_page_id] = @pHtmlPageId AND [announcement_id] = @pAnnouncementId AND [section_cd] = @pSectionCd
END
GO

GRANT EXEC ON dbo.proc_cm_DeleteAnnouncement TO PUBLIC
GO
